package com.schoolcardinfo.beans;

public class SchoolId {
	private int sid;//卡号
	private int studentId;//学号
	private int status;//状态
	private double balance;//余额
	private Id_StudentInfo studentInfo;
	
	@Override
	public String toString() {
		return "SchoolId [sid=" + sid + ", studentId=" + studentId + ", status=" + status + ", balance=" + balance
				+ ", studentInfo=" + studentInfo + "]";
	}

	public int getSid() {
		return sid;
	}

	public void setSid(int sid) {
		this.sid = sid;
	}

	public int getStudentId() {
		return studentId;
	}

	public void setStudentId(int studentId) {
		this.studentId = studentId;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public double getBalance() {
		return balance;
	}

	public void setBalance(double balance) {
		this.balance = balance;
	}

	public Id_StudentInfo getStudentInfo() {
		return studentInfo;
	}

	public void setStudentInfo(Id_StudentInfo studentInfo) {
		this.studentInfo = studentInfo;
	}

	public SchoolId(int sid, int studentId, int status, double balance, Id_StudentInfo studentInfo) {
		super();
		this.sid = sid;
		this.studentId = studentId;
		this.status = status;
		this.balance = balance;
		this.studentInfo = studentInfo;
	}

	public SchoolId() {
		super();
		// TODO Auto-generated constructor stub
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		long temp;
		temp = Double.doubleToLongBits(balance);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + sid;
		result = prime * result + status;
		result = prime * result + studentId;
		result = prime * result + ((studentInfo == null) ? 0 : studentInfo.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		SchoolId other = (SchoolId) obj;
		if (Double.doubleToLongBits(balance) != Double.doubleToLongBits(other.balance))
			return false;
		if (sid != other.sid)
			return false;
		if (status != other.status)
			return false;
		if (studentId != other.studentId)
			return false;
		if (studentInfo == null) {
			if (other.studentInfo != null)
				return false;
		} else if (!studentInfo.equals(other.studentInfo))
			return false;
		return true;
	}
}
